﻿@model MvcApplication4.Models.Category
@{
    ViewBag.Title = "CategorySelected";
    Layout = "~/Views/Shared/_Layout.cshtml";
    Session.Add(MvcApplication4.Controllers.SaveVarsController.Session_LastKnownPage, Request.Url.ToString());
    long tempID = Convert.ToInt64(Html.DisplayFor(model => model.CategoryId).ToString());
}

<h2>
<p></p>
Create thread in @Html.DisplayFor(model => model.Title)
<p></p>
@if (Html.DisplayFor(model => model.SubCategory).ToString() != "")
{
    if(Html.DisplayFor(model => model.CategoryLink.SubCategory).ToString() != "")
    {
        if (Html.DisplayFor(model => model.CategoryLink.SubCategory).ToString() != "")
        {
            @Html.Raw(".. > ");
        }
        @Html.ActionLink(@Html.DisplayFor(model => model.CategoryLink.CategoryLink.Title).ToString(), "CategorySelected", new { id = Convert.ToInt32(@Html.DisplayFor(model => model.CategoryLink.CategoryLink.CategoryId).ToString()) })
        @Html.Raw(" > ");
    }
        
    @Html.ActionLink(@Html.DisplayFor(model => model.CategoryLink.Title).ToString(), "CategorySelected", new { id = Convert.ToInt32(@Html.DisplayFor(model => model.CategoryLink.CategoryId).ToString()) })
    @Html.Raw(" > ");
}
 @Html.DisplayFor(model => model.Title).ToString()
</h2>

<div id="ReturnMenu">
    @Html.ActionLink("Return to Categories", "Index")
</div>

@{Html.RenderAction("ContainedSubCategories");}

<div style="height:100px;"></div>
<div>@Html.ActionLink("Create Thread", "CreateThread", new { id = tempID })</div>

<div id = "Thread_Box">
    <div id="Thread_Info">
        <div id = "Thread_Info_Tags_TITLE">Tags</div>
        <div id = "Thread_Info_text_TITLE">Thread Name</div>
        <div id = "Thread_Info_Views_TITLE">Views</div>
        <div id = "Thread_Info_LastPost_TITLE">Last Post</div>
    </div>
</div>

@{Html.RenderAction("ContainedThreads", new { id = tempID });}

<div id="ReturnMenu">
    @Html.ActionLink("Return to Categories", "Index")
</div>